package com.qijian.maindata.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qijian.maindata.domain.BomDetail;
import com.qijian.maindata.domain.Line;
import com.qijian.maindata.domain.LineProcess;
import com.qijian.maindata.domain.dto.LineProcessExport;
import com.qijian.maindata.domain.query.LineProcessQuery;
import com.qijian.maindata.domain.vo.LineProcessBomVo;
import com.qijian.maindata.domain.vo.LineProcessDataVo;
import com.qijian.maindata.domain.vo.LineProcessVo;

import java.util.List;
import java.util.Set;

/**
 * 工艺Service接口
 *
 * @author qijian
 * @date 2021-09-03
 */
public interface ILineProcessService extends IService<LineProcess> {
    List<LineProcessVo> listVo(Wrapper<LineProcessQuery> queryWrapper);

    List<LineProcessVo> listAndImageVo(Wrapper<LineProcessQuery> queryWrapper);

    BomDetail saveData(BomDetail bom, Line line, List<LineProcess> lineProcesss);

    Boolean addBatchLine(List<LineProcessDataVo> resources);

    void copy(Long lineId);

    List<LineProcessBomVo> selectProcessVo(QueryWrapper<LineProcessQuery> queryWrapper);

    List<LineProcessBomVo> selectEcnProcessVo(LineProcessQuery query, Integer type);

    List<LineProcessBomVo> groupByTypeName(Long bomId, Boolean isTree, String typeName, Boolean isOut);

    List<LineProcessBomVo> listByTypeName(Long bomId, Boolean isTree, String typeName, Boolean isOut);

    List<LineProcessBomVo> listByTypeName4de(Long bomId, Boolean isTree, String typeName, Boolean isOut, String requestType);


    List<LineProcess> lineMaxSort(Set<Long> lineIds);

    List<LineProcessVo> getProcessType(Long bomId);

    boolean editProcess(List<LineProcess> resources);

    void exportProcess(Long bomId, List<LineProcessExport> list);

    int updateProcessByProcessId(Long mainId);

    /***
     * 根据定额申请定额更新工单上的定额
     * @param mainId
     */
    void updateProcessOrderByDeProcessId(Long mainId);

    /***
     * 根据定额申请定额更新工单上的生产位置
     * @param mainId
     */
    void updateProcessOrderFactoryByDeProcessId(Long mainId);


}
